
#ifndef	LEVEL_SLIDE_HPP
#define	LEVEL_SLIDE_HPP

#include <physics/physics.hpp>
#include <level/slide/object/object_fwd.hpp>
#include <messenger/messenger.hpp>
#include <sfml/helper.hpp>
#include <rapidxml/rapidxml.hpp>
#include <boost/unordered_map.hpp>
#include <boost/array.hpp>
#include <boost/scoped_ptr.hpp>

class slide
{
	public:

		slide( rapidxml::xml_node<> const * const slide_node );
		~slide( );
		void step( float delta_time );
		void draw( );

		world_ptr world( ) const
		{
			return m_world;
		}

	private:

		void message_callback( std::string const & message_name, message_data_ptr data );

		typedef	boost::unordered_map< std::string, object_ptr > object_map_t;
		typedef	boost::array< body_ptr, 4 > walls_array_t;

		world_ptr m_world;
		object_map_t m_objects;
		walls_array_t m_walls;
		sprite_ptr m_background;

		boost::scoped_ptr<contact_listener> m_contact_listener;
		boost::signals2::scoped_connection m_messenger_connection;

#if PHYSICS_DEBUG
		boost::shared_ptr<debug_draw> m_debug_draw;
#endif
};

#endif	//LEVEL_SLIDE_HPP
